<?php
namespace app\tadmin\model;
use app\common\model\ArticleSingle as SingleModel;
/**
 * 文档分类
 */
class ArticleSingle extends SingleModel {

    protected $autoWriteTimestamp = true;

    public static function edit($data){
        $single = new self;
        if($data['id'] > 0){
            $id = $data['id'];
            unset($data['id']);
            return $single->allowField(true)->save($data,['id' => $id]);
        }else{
            return $single->allowField(true)->save($data);
        }
    }

}